
0800              2           DCM "WRITE FM.LIST"
AAC1              3           ORG $AAC1
AAC1              4           OBJ $800
AAC1              5  ;
0027              6  SCRATCH  EPZ $27
002B              7  BOOTSLOT EPZ $2B
003E              8  ROMRWTS  EPZ $3E
003D              9  SECNUM   EPZ $3D
0044             10  OPRND    EPZ $44
0042             11  BUFADR   EPZ $42
0040             12  DOSIMG   EPZ $40
0048             13  IOBADR   EPZ $48
0478             14  L0478    EQU $478
04F8             15  L04F8    EQU $4F8
084D             16  L084D    EQU $84D
08FF             17  L08FF    EQU $8FF
08FE             18  L08FE    EQU $8FE
08FD             19  L08FD    EQU $8FD
090B             20  L090B    EQU $090B
9D84             21  DOSSTRT  EQU $9D84

LISA 2.5                                                     


A27D             22  DOVERIFY EQU $A27D
A2EA             23  DOCLOSE  EQU $A2EA
A546             24  RWC2     EQU $A546
A6A8             25  FMDRVR   EQU $A6A8
A6BC             26  FMDRVR0  EQU $A6BC
A6D2             27  DOERROR  EQU $A6D2
A764             28  LOCBUF   EQU $A764
A909             29  KWDRPRMS EQU $A909
AA51             30  CURSTAT  EQU $AA51
AA5F             31  CMDINDX  EQU $AA5F
BD00             32  RWTSENT  EQU $BD00
BFC8             33  REBOOT   EQU $BFC8
BFED             34  DISKFULL EQU $BFED
C000             35  MEMTOP   EQU $C000
FB2F             36  MONINIT  EQU $FB2F
FC58             37  CLRHOME  EQU $FC58
FD0C             38  RDCHAR   EQU $FD0C
FDDA             39  PRBYTE   EQU $FDDA
FDED             40  COUT     EQU $FDED
FE89             41  SETKBD   EQU $FE89
FE93             42  SETVID   EQU $FE93
AAC1             43  ;
AAC1             44  ;
AAC1             45  ;
AAC1             46  ;
AAC1             47  ; THE FOLLOWING ADDRESSES ARE
AAC1             48  ; SHARED WITH THE CDI FILE
AAC1             49  ;
AAC1 E8 B7       50  RWTSPADR ADR TBLTYPE
AAC3 BB B3       51  VTOCPADR ADR VTOCSB
AAC5 BB B4       52  DIRPADR  ADR DIRSECBF
AAC7 00 C0       53           ADR MEMTOP
AAC9             54  ;
AAC9             55  ;
AAC9             56  ; File manager subroutine table.
AAC9             57  ;
AAC9             58  ;
AAC9 7E B3       59  FMFTBL   ADR NOERROR-1
AACB 21 AB       60           ADR OPNHNDLR-1
AACD 05 AC       61           ADR CLSHNDLR-1
AACF 57 AC       62           ADR RDHNDLR-1
AAD1 6F AC       63           ADR WRTHNDLR-1
AAD3 2A AD       64           ADR DELHNDLR-1
AAD5 97 AD       65           ADR CATHNDLR-1
AAD7 EE AC       66           ADR LCKHNDLR-1
AAD9 F5 AC       67           ADR UNLKHNDL-1
AADB 39 AC       68           ADR RENHNDLR-1
AADD 11 AD       69           ADR POSHNDLR-1
AADF 8D AE       70           ADR INITHNDL-1
AAE1 17 AD       71           ADR VFYHNDLR-1
AAE3 7E B3       72           ADR NOERROR-1
AAE5             73  ;
AAE5             74  ; Read Subcode table.
AAE5             75  ;
AAE5             76  ;
AAE5 7E B3       77  FMRSUB   ADR NOERROR-1
AAE7 89 AC       78           ADR RD1BYTE-1
AAE9 95 AC       79           ADR RDRANGE-1

LISA 2.5                                                     


AAEB 86 AC       80           ADR POSRD1B-1
AAED 92 AC       81           ADR POSRDR-1
AAEF 7E B3       82           ADR NOERROR-1
AAF1             83  ;
AAF1             84  ; Write subcode table.
AAF1             85  ;
AAF1 7E B3       86  FMWSUB   ADR NOERROR-1
AAF3 BD AC       87           ADR WRT1BYTE-1
AAF5 C9 AC       88           ADR WRTRANGE-1
AAF7 BA AC       89           ADR POSWRT1B-1
AAF9 C6 AC       90           ADR POSWRTR-1
AAFB 7E B3       91           ADR NOERROR-1
AAFD             92  ;
AAFD             93  ;
AAFD             94  ;
AAFD             95  ;
AAFD             96  ; EXTERNAL ENTRY POINT FOR FILE
AAFD             97  ; MANGER.
AAFD             98  ;
AAFD             99  ; X=0, allocate a new file if
AAFD            100  ; file not found in dir.
AAFD            101  ;
AAFD            102  ; X=1, do not allocate a new file
AAFD            103  ; if file not found.
AAFD            104  ;
AAFD            105  ;
AAFD            106  ;
AAFD E0 00      107  FMEXT    CPX #0
AAFF F0 02      108           BEQ >0
AB01 A2 02      109           LDX #2
AB03 8E 5F AA   110  ^0       STX CMDINDX
AB06            111  ;
AB06            112  ;
AB06            113  ;
AB06            114  ; NORMAL ENTRY FOR FILE MANAGER
AB06            115  ;
AB06            116  ;
AB06 BA         117  FILEMNGR TSX 
AB07 8E 9B B3   118           STX STKSAVE
AB0A            119  ;
AB0A            120  ; GET FM PARMS
AB0A            121  ;
AB0A 20 6A AE   122           JSR LDFMW
AB0D            123  ;
AB0D            124  ; CHECK TO SEE IF WE HAVE A VALID
AB0D            125  ; FM OPCODE..
AB0D            126  ;
AB0D AD BB B5   127           LDA FMOPCOD
AB10 C9 0D      128           CMP #$D
AB12 B0 0B      129           BCS >1
AB14            130  ;
AB14            131  ; USING OPCODE AS INDEX INTO
AB14            132  ; FMFTBL, JMP TO APPROPRIATE
AB14            133  ; ROUTINE.
AB14            134  ;
AB14 0A         135           ASL 
AB15 AA         136           TAX 
AB16 BD CA AA   137           LDA FMFTBL+1,X

LISA 2.5                                                     


AB19 48         138           PHA 
AB1A BD C9 AA   139           LDA FMFTBL,X
AB1D 48         140           PHA 
AB1E 60         141           RTS 
AB1F            142  ;
AB1F            143  ;
AB1F            144  ; JMP TO OPCODE RANGE ERROR
AB1F            145  ; HANDLER
AB1F            146  ;
AB1F 4C 63 B3   147  ^1       JMP RANGERR
AB22            148  ;
AB22            149  ;
AB22            150  ;
AB22            151  ; OPNHNDLR- OPENS A FILE
AB22            152  ;
AB22 20 28 AB   153  OPNHNDLR JSR CMNOPN
AB25 4C 7F B3   154           JMP NOERROR
AB28            155  ;
AB28            156  ;
AB28            157  ; CMNOPN- USED TO OPEN A FILE,
AB28            158  ; CALLED BY VARIOUS FILE MANAGER
AB28            159  ; ROUTINES.
AB28            160  ;
AB28            161  ;
AB28            162  ;
AB28            163  ; INIT FILE MANAGER WORK AREA
AB28            164  ;
AB28 20 DC AB   165  CMNOPN   JSR INITFMW
AB2B            166  ;
AB2B            167  ; SET SECTOR LENGTH TO 256 BYTEST
AB2B            168  ;
AB2B A9 01      169           LDA #$1
AB2D 8D E3 B5   170           STA SECTLEN+1
AB30            171  ;
AB30            172  ; IF RECORD LEN = 0, SET TO 1
AB30            173  ;
AB30 AE BE B5   174           LDX RECNUM+1
AB33 AD BD B5   175           LDA RECNUM
AB36 D0 05      176           BNE >3
AB38 E0 00      177           CPX #0
AB3A D0 01      178           BNE >3
AB3C E8         179           INX 
AB3D 8D E8 B5   180  ^3       STA OPNRCLEN
AB40 8E E9 B5   181           STX OPNRCLEN+1
AB43            182  ;
AB43            183  ; SEARCH FOR THE FILENAME IN THE
AB43            184  ; DIRECTORY, ALLOCATE IF NOT FOUND
AB43            185  ;
AB43 20 C9 B1   186           JSR LCDIRENT
AB46 90 5E      187           BCC PLTSDIR
AB48            188  ;
AB48            189  ; FILE NOT FOUND IN DIRECTORY,
AB48            190  ; SEE IF A FILE IS REQUIRED.
AB48            191  ;
AB48 8E 9C B3   192           STX DIRINDX
AB4B AE 5F AA   193           LDX CMDINDX
AB4E BD 09 A9   194           LDA KWDRPRMS,X
AB51 AE 9C B3   195           LDX DIRINDX

LISA 2.5                                                     


AB54 4A         196           LSR 
AB55 B0 0D      197           BCS >5
AB57            198  ;
AB57            199  ;
AB57            200  ; AT THIS POINT, THE FILE MUST BE
AB57            201  ; PRESENT, SEE IF WE ARE LOADING
AB57            202  ; APPLESOFT FROM DISK.
AB57            203  ;
AB57 AD 51 AA   204           LDA CURSTAT
AB5A C9 C0      205           CMP #$C0
AB5C D0 03      206           BNE >4
AB5E            207  ;
AB5E            208  ; LOADING AS.  ERROR= LANG NOT AVL
AB5E            209  ;
AB5E 4C 5F B3   210           JMP LNOTAVL
AB61            211  ;
AB61            212  ; LOADING A NORMAL PROGRAM, PRINT
AB61            213  ; FILE NOT FOUND.
AB61            214  ;
AB61 4C 73 B3   215  ^4       JMP FNOTFND
AB64            216  ;
AB64            217  ;
AB64            218  ; FILE WAS NOT REQUIRED TO BE
AB64            219  ; IN THE DIRECTORY, SET IT
AB64            220  ; UP
AB64            221  ;
AB64            222  ;
AB64            223  ; SET SECTOR COUNT TO 1
AB64            224  ;
AB64 A9 00      225  ^5       LDA #0
AB66 9D E8 B4   226           STA FILESIZE+1,X
AB69 A9 01      227           LDA #$1
AB6B 9D E7 B4   228           STA FILESIZE,X
AB6E 8E 9C B3   229           STX DIRINDX
AB71            230  ;
AB71            231  ; ALLOCATE A SECTOR FOR T/S LIST
AB71            232  ;
AB71 20 44 B2   233           JSR ALLOCSEC
AB74            234  ;
AB74            235  ; SET UP T/S LIST AND WORK BUFFER
AB74            236  ;
AB74 AE 9C B3   237           LDX DIRINDX
AB77 9D C7 B4   238           STA TSSECTOR,X
AB7A 8D D2 B5   239           STA FTSS
AB7D 8D D4 B5   240           STA CURTSS
AB80 AD F1 B5   241           LDA SCALAREA+1
AB83 9D C6 B4   242           STA TSTRACK,X
AB86 8D D1 B5   243           STA FTSTS
AB89 8D D3 B5   244           STA CURTSTS
AB8C AD C2 B5   245           LDA FILETYPE
AB8F 9D C8 B4   246           STA FILTYP,X
AB92            247  ;
AB92            248  ; WRITE DIRECTORY BACK TO DISK
AB92            249  ;
AB92 20 37 B0   250           JSR WRTDIRSC
AB95            251  ;
AB95            252  ; INIT THE WORK BUFFER, DATA
AB95            253  ; BUFFER, AND T/S BUFFERS

LISA 2.5                                                     


AB95            254  ;
AB95 20 0C AF   255           JSR SELTSBUF
AB98 20 D6 B7   256           JSR ZEROBUFR
AB9B 20 3A AF   257           JSR SETUPRW
AB9E            258  ;
AB9E            259  ; SET RETURN CODE TO FILE NOT FND
AB9E            260  ;
AB9E AE 9C B3   261           LDX DIRINDX
ABA1 A9 06      262           LDA #6
ABA3 8D C5 B5   263           STA RTNCODE
ABA6            264  ;
ABA6            265  ;
ABA6            266  ;
ABA6            267  ; FALL THROUGH FROM ABOVE (FILE
ABA6            268  ; CREATED AND ENTERED INTO DIR)
ABA6            269  ;
ABA6            270  ; -OR- 
ABA6            271  ;
ABA6            272  ; COME FROM DIR LOOKUP IF FILE
ABA6            273  ; WAS FOUND IN DIRECTORY.
ABA6            274  ;
ABA6            275  ;
ABA6            276  ;
ABA6            277  ; COPY T/S LIST INFO TO WORK 
ABA6            278  ; BUFFER
ABA6            279  ;
ABA6 BD C6 B4   280  PLTSDIR  LDA TSTRACK,X
ABA9 8D D1 B5   281           STA FTSTS
ABAC BD C7 B4   282           LDA TSSECTOR,X
ABAF 8D D2 B5   283           STA FTSS
ABB2 BD C8 B4   284           LDA FILTYP,X
ABB5            285  ;
ABB5            286  ; COPY FILE TYPE TO WORK BUFFER
ABB5            287  ;
ABB5 8D C2 B5   288           STA FILETYPE
ABB8 8D F6 B5   289           STA FTYPE
ABBB            290  ;
ABBB            291  ; COPY FILE SIZE TO WORK BUFFER
ABBB            292  ;
ABBB BD E7 B4   293           LDA FILESIZE,X
ABBE 8D EE B5   294           STA SECCNT
ABC1 BD E8 B4   295           LDA FILESIZE+1,X
ABC4 8D EF B5   296           STA SECCNT+1
ABC7 8E D9 B5   297           STX DIRSECIX+1
ABCA            298  ;
ABCA            299  ; INIT EOF TO 65535 (INFINITY) 
ABCA            300  ;
ABCA A9 FF      301           LDA #$FF
ABCC 8D E0 B5   302           STA RELSLRD
ABCF 8D E1 B5   303           STA RELSLRD+1
ABD2            304  ;
ABD2            305  ; SET UP # OF ENTRIES IN T/S LIST
ABD2            306  ;
ABD2 AD E2 B3   307           LDA NUMTSENT
ABD5 8D DA B5   308           STA SECPERTS
ABD8            309  ;
ABD8            310  ; READ IN THE FIRST T/S LIST
ABD8            311  ; (IF THERE IS ONE)

LISA 2.5                                                     


ABD8            312  ;
ABD8 18         313           CLC 
ABD9 4C 5E AF   314           JMP RDTSLIST
ABDC            315  ;
ABDC            316  ;
ABDC            317  ; INITIALIZE FILE MANAGER WORK
ABDC            318  ; AREA.
ABDC            319  ;
ABDC            320  ;
ABDC            321  ; ZERO OUT T/S LIST
ABDC            322  ;
ABDC A9 00      323  INITFMW  LDA #0
ABDE AA         324           TAX 
ABDF 9D D1 B5   325  ^6       STA FTSTS,X
ABE2 E8         326           INX 
ABE3 E0 2D      327           CPX #$2D
ABE5 D0 F8      328           BNE <6
ABE7            329  ;
ABE7            330  ; INIT VOLUME # (COMPLIMENTED),
ABE7            331  ; SLOT, AND DRIVE #.
ABE7            332  ;
ABE7 AD BF B5   333           LDA VOLVAL
ABEA 49 FF      334           EOR #$FF
ABEC 8D F9 B5   335           STA VOLNUMBR
ABEF AD C0 B5   336           LDA DRVVAL
ABF2 8D F8 B5   337           STA DRVNUMBR
ABF5 AD C1 B5   338           LDA SLOTVAL
ABF8 0A         339           ASL 
ABF9 0A         340           ASL 
ABFA 0A         341           ASL 
ABFB 0A         342           ASL 
ABFC AA         343           TAX 
ABFD 8E F7 B5   344           STX SLOT16
AC00            345  ;
AC00            346  ; SET UP FOR DIRECTORY TRACK
AC00            347  ;
AC00 A9 11      348           LDA #$11
AC02 8D FA B5   349           STA TRKNUMBR
AC05 60         350           RTS 
AC06            351  ;
AC06            352  ;
AC06            353  ; CLOSE FILE HANDLER.
AC06            354  ;
AC06            355  ;
AC06            356  ; CHECK TO SEE IF DATA BUFFER OR
AC06            357  ; T/S BUFFER NEEDS TO BE WRITTEN
AC06            358  ; TO DISK.
AC06            359  ;
AC06 20 1D AF   360  CLSHNDLR JSR CHKBUF
AC09 20 34 AF   361           JSR CHKTS
AC0C            362  ;
AC0C            363  ; RELEASE ANY UNALLOCATED SECTORS
AC0C            364  ;
AC0C 20 C3 B2   365           JSR RLSALLC
AC0F            366  ;
AC0F            367  ; CHECK TO SEE IF FILE SIZE
AC0F            368  ; HAS CHANGED.
AC0F            369  ;

LISA 2.5                                                     


AC0F A9 02      370           LDA #2
AC11 2D D5 B5   371           AND FLAGS
AC14 F0 21      372           BEQ >7
AC16            373  ;
AC16            374  ; IF SO, READ VTOC, UPDATE IT,
AC16            375  ; READ DIR, AND UPDATE FILE SIZE
AC16            376  ;
AC16 20 F7 AF   377           JSR RWVTOC
AC19 A9 00      378           LDA #0
AC1B 18         379           CLC 
AC1C 20 11 B0   380  ^6       JSR RDDIRSEC
AC1F 38         381           SEC 
AC20 CE D8 B5   382           DEC DIRSECIX
AC23 D0 F7      383           BNE <6
AC25 AE D9 B5   384           LDX DIRSECIX+1
AC28 AD EE B5   385           LDA SECCNT
AC2B 9D E7 B4   386           STA FILESIZE,X
AC2E AD EF B5   387           LDA SECCNT+1
AC31 9D E8 B4   388           STA FILESIZE+1,X
AC34 20 37 B0   389           JSR WRTDIRSC
AC37            390  ;
AC37            391  ; NORMAL CLOSE EXIT PT.
AC37            392  ;
AC37 4C 7F B3   393  ^7       JMP NOERROR
AC3A            394  ;
AC3A            395  ;
AC3A            396  ; RENAME HANDLER.
AC3A            397  ;
AC3A 20 28 AB   398  RENHNDLR JSR CMNOPN          ;LOOKUP FILE
AC3D            399  ;
AC3D            400  ; SEE IF THE FILE IS LOCKED
AC3D            401  ;
AC3D AD F6 B5   402           LDA FTYPE
AC40 30 2B      403           BMI FILOCKED
AC42            404  ;
AC42            405  ;
AC42            406  ; IF NOT, POINT BUFADR AT THE
AC42            407  ; SECOND FILENAME AND COPY IT
AC42            408  ; INTO THE DIRECTORY
AC42            409  ;
AC42 AD BD B5   410           LDA RECNUM
AC45 85 42      411           STA BUFADR
AC47 AD BE B5   412           LDA RECNUM+1
AC4A 85 43      413           STA BUFADR+1
AC4C AE 9C B3   414           LDX DIRINDX
AC4F 20 1C B2   415           JSR COPYFNAM
AC52            416  ;
AC52            417  ; WRITE THE DIRECTORY BACK TO
AC52            418  ; DISK
AC52            419  ;
AC52 20 37 B0   420           JSR WRTDIRSC
AC55 4C 7F B3   421           JMP NOERROR
AC58            422  ;
AC58            423  ;
AC58            424  ; READ FUNCTION HANDLER.
AC58            425  ;
AC58 AD BC B5   426  RDHNDLR  LDA SUBCODE
AC5B            427  ;

LISA 2.5                                                     


AC5B            428  ; MAKE SURE SUBCODE IS < 5
AC5B            429  ;
AC5B C9 05      430           CMP #5
AC5D B0 0B      431           BCS >8
AC5F            432  ;
AC5F            433  ; USE SUBCODE AS INDEX INTO FMRSUB
AC5F            434  ; TABLE, JUMP TO THAT ADDRESS
AC5F            435  ;
AC5F 0A         436           ASL 
AC60 AA         437           TAX 
AC61 BD E6 AA   438           LDA FMRSUB+1,X
AC64 48         439           PHA 
AC65 BD E5 AA   440           LDA FMRSUB,X
AC68 48         441           PHA 
AC69 60         442           RTS 
AC6A 4C 67 B3   443  ^8       JMP RANGERR2
AC6D            444  ;
AC6D            445  ; ERROR EXIT POINT IF THE
AC6D            446  ; FILE WAS LOCKED
AC6D            447  ;
AC6D 4C 7B B3   448  FILOCKED JMP FILELOCK
AC70            449  ;
AC70            450  ;
AC70            451  ; WRITE FUNCTION HANDLER.
AC70            452  ;
AC70            453  ;
AC70            454  ; MAKE SURE THE FILE IS NOT LOCKED
AC70            455  ;
AC70 AD F6 B5   456  WRTHNDLR LDA FTYPE
AC73 30 F8      457           BMI FILOCKED
AC75            458  ;
AC75            459  ; CHECK SUBCODE (< 5)
AC75            460  ;
AC75 AD BC B5   461           LDA SUBCODE
AC78 C9 05      462           CMP #5
AC7A B0 EE      463           BCS <8
AC7C            464  ;
AC7C            465  ; USE SUBCODE AS INDEX INTO
AC7C            466  ; FMWSUB TABLE
AC7C            467  ;
AC7C 0A         468           ASL 
AC7D AA         469           TAX 
AC7E BD F2 AA   470           LDA FMWSUB+1,X
AC81 48         471           PHA 
AC82 BD F1 AA   472           LDA FMWSUB,X
AC85 48         473           PHA 
AC86 60         474           RTS 
AC87            475  ;
AC87            476  ;
AC87            477  ; POSITION AND READ 1 BYTE HANDLER
AC87            478  ;
AC87            479  ; (POSITIONS AND DROPS THROUGH TO
AC87            480  ; READ ONE BYTE)
AC87            481  ;
AC87 20 00 B3   482  POSRD1B  JSR CALPOSN
AC8A            483  ;
AC8A            484  ; READ ONE BYTE ROUTINE
AC8A            485  ;

LISA 2.5                                                     


AC8A 20 A8 AC   486  RD1BYTE  JSR RDABYTE
AC8D 8D C3 B5   487           STA DATABYTE
AC90 4C 7F B3   488           JMP NOERROR
AC93            489  ;
AC93            490  ;
AC93            491  ; POSITION AND READ A RANGE OF
AC93            492  ; BYTES
AC93            493  ;
AC93 20 00 B3   494  POSRDR   JSR CALPOSN
AC96            495  ;
AC96            496  ; READ A RANGE OF BYTES
AC96            497  ;
AC96 20 B5 B1   498  RDRANGE  JSR DECRNG
AC99 20 A8 AC   499           JSR RDABYTE
AC9C 48         500           PHA 
AC9D 20 A2 B1   501           JSR MOVRANG
ACA0 A0 00      502           LDY #0
ACA2 68         503           PLA 
ACA3 91 42      504           STA (BUFADR),Y
ACA5 4C 96 AC   505           JMP RDRANGE
ACA8            506  ;
ACA8            507  ;
ACA8            508  ; RDABYTE READS A DATA BYTE FROM
ACA8            509  ; THE FILE, READING IN ADDITIONAL
ACA8            510  ; SECTORS AS NECESSARY.
ACA8            511  ;
ACA8 20 B6 B0   512  RDABYTE  JSR RDNXTDA
ACAB B0 0B      513           BCS >9
ACAD B1 42      514           LDA (BUFADR),Y
ACAF 48         515           PHA 
ACB0 20 5B B1   516           JSR INCREC
ACB3 20 94 B1   517           JSR INCPOS
ACB6 68         518           PLA 
ACB7 60         519           RTS 
ACB8 4C 6F B3   520  ^9       JMP ENDATA
ACBB            521  ;
ACBB            522  ;
ACBB            523  ; POSITION AND WRITE ONE BYTE
ACBB            524  ; HANDLER.
ACBB            525  ;
ACBB 20 00 B3   526  POSWRT1B JSR CALPOSN
ACBE            527  ;
ACBE            528  ;
ACBE            529  ; WRITE ONE BYTE HANDLER
ACBE            530  ;
ACBE AD C3 B5   531  WRT1BYTE LDA DATABYTE
ACC1 20 DA AC   532           JSR WRTBYTE
ACC4 4C 7F B3   533           JMP NOERROR
ACC7            534  ;
ACC7            535  ; POSITION AND WRITE RANGE
ACC7            536  ;
ACC7 20 00 B3   537  POSWRTR  JSR CALPOSN
ACCA            538  ;
ACCA            539  ;
ACCA            540  ; WRITE A RANGE OF BYTES
ACCA            541  ;
ACCA 20 A2 B1   542  WRTRANGE JSR MOVRANG
ACCD A0 00      543           LDY #0

LISA 2.5                                                     


ACCF B1 42      544           LDA (BUFADR),Y
ACD1 20 DA AC   545           JSR WRTBYTE
ACD4 20 B5 B1   546           JSR DECRNG
ACD7 4C CA AC   547           JMP WRTRANGE
ACDA            548  ;
ACDA            549  ;
ACDA            550  ; WRITE A SINGLE BYTE TO A FILE
ACDA            551  ;
ACDA 48         552  WRTBYTE  PHA 
ACDB 20 B6 B0   553           JSR RDNXTDA
ACDE 68         554           PLA 
ACDF 91 42      555           STA (BUFADR),Y
ACE1 A9 40      556           LDA #$40
ACE3 0D D5 B5   557           ORA FLAGS
ACE6 8D D5 B5   558           STA FLAGS
ACE9 20 5B B1   559           JSR INCREC
ACEC 4C 94 B1   560           JMP INCPOS
ACEF            561  ;
ACEF            562  ;
ACEF            563  ; LOCK FUNCTION HANDLER
ACEF            564  ;
ACEF A9 80      565  LCKHNDLR LDA #$80
ACF1 8D 9E B3   566           STA ALLCFLG
ACF4 D0 05      567           BNE >0
ACF6            568  ;
ACF6            569  ;
ACF6            570  ; UNLOCK FUNCTION HANDLER
ACF6            571  ;
ACF6 A9 00      572  UNLKHNDL LDA #0
ACF8 8D 9E B3   573           STA ALLCFLG
ACFB 20 28 AB   574  ^0       JSR CMNOPN
ACFE AE 9C B3   575           LDX DIRINDX
AD01 BD C8 B4   576           LDA FILTYP,X
AD04 29 7F      577           AND #$7F
AD06 0D 9E B3   578           ORA ALLCFLG
AD09 9D C8 B4   579           STA FILTYP,X
AD0C 20 37 B0   580           JSR WRTDIRSC
AD0F 4C 7F B3   581  ^1       JMP NOERROR
AD12            582  ;
AD12            583  ;
AD12            584  ; POSITION FUNCTION HANDLER
AD12            585  ;
AD12 20 00 B3   586  POSHNDLR JSR CALPOSN
AD15 4C 7F B3   587           JMP NOERROR
AD18            588  ;
AD18            589  ;
AD18            590  ; VERIFY HANDLER
AD18            591  ;
AD18 20 28 AB   592  VFYHNDLR JSR CMNOPN
AD1B            593  ;
AD1B            594  ; READ UNTIL EOF
AD1B            595  ;
AD1B 20 B6 B0   596  ^2       JSR RDNXTDA
AD1E B0 EF      597           BCS <1
AD20 EE E4 B5   598           INC FILEPOSN
AD23 D0 F6      599           BNE <2
AD25 EE E5 B5   600           INC FILEPOSN+1
AD28 4C 1B AD   601           JMP <2

LISA 2.5                                                     


AD2B            602  ;
AD2B            603  ;
AD2B            604  ; DELETE HANDLER
AD2B            605  ;
AD2B 20 28 AB   606  DELHNDLR JSR CMNOPN
AD2E            607  ;
AD2E            608  ; SEE IF THE FILE IS LOCKED
AD2E            609  ;
AD2E AE 9C B3   610           LDX DIRINDX
AD31 BD C8 B4   611           LDA FILTYP,X
AD34 10 03      612           BPL >3
AD36 4C 7B B3   613           JMP FILELOCK
AD39            614  ;
AD39            615  ; IF THE FILE IS NOT LOCKED,
AD39            616  ; COPY THE T/S LIST POINTER
AD39            617  ; AND PUT $FF IN THE OLD
AD39            618  ; T/S LIST POINTER SPOT
AD39            619  ;
AD39 AE 9C B3   620  ^3       LDX DIRINDX
AD3C BD C6 B4   621           LDA TSTRACK,X
AD3F 8D D1 B5   622           STA FTSTS
AD42 9D E6 B4   623           STA FILESIZE-1,X
AD45 A9 FF      624           LDA #$FF
AD47 9D C6 B4   625           STA TSTRACK,X
AD4A BC C7 B4   626           LDY TSSECTOR,X
AD4D 8C D2 B5   627           STY FTSS
AD50            628  ;
AD50            629  ; WRITE DIRECTORY BACK TO DISK
AD50            630  ;
AD50 20 37 B0   631           JSR WRTDIRSC
AD53            632  ;
AD53            633  ; READ THE T/S LIST SECTORS AND
AD53            634  ; UPDATE VTOC UNTIL THERE ARE
AD53            635  ; NO MORE T/S SECTORS
AD53            636  ;
AD53 18         637           CLC 
AD54 20 5E AF   638  RDNXTTS  JSR RDTSLIST
AD57 B0 2A      639           BCS >6
AD59 20 0C AF   640           JSR SELTSBUF
AD5C A0 0C      641           LDY #$C
AD5E 8C 9C B3   642  ^4       STY DIRINDX
AD61 B1 42      643           LDA (BUFADR),Y
AD63            644  ;
AD63            645  ; IF TRACK NUMBER IS ZERO OR
AD63            646  ; MINUS, SKIP IT
AD63            647  ;
AD63 30 0B      648           BMI >5
AD65 F0 09      649           BEQ >5
AD67            650  ;
AD67            651  ; OTHERWISE UPDATE VTOC
AD67            652  ;
AD67 48         653           PHA 
AD68 C8         654           INY 
AD69 B1 42      655           LDA (BUFADR),Y
AD6B A8         656           TAY 
AD6C 68         657           PLA 
AD6D 20 89 AD   658           JSR FREESECT
AD70            659  ;

LISA 2.5                                                     


AD70            660  ; GET NEXT T/S PAIR
AD70            661  ;
AD70 AC 9C B3   662  ^5       LDY DIRINDX
AD73 C8         663           INY 
AD74 C8         664           INY 
AD75 D0 E7      665           BNE <4
AD77            666  ;
AD77            667  ; IF AT END OF T/S SECTOR, FREE
AD77            668  ; THE SECTOR IT USES AND TRY
AD77            669  ; TO GET THE NEXT SECTOR
AD77            670  ;
AD77 AD D3 B5   671           LDA CURTSTS
AD7A AC D4 B5   672           LDY CURTSS
AD7D 20 89 AD   673           JSR FREESECT
AD80 38         674           SEC 
AD81 B0 D1      675           BCS RDNXTTS
AD83 20 FB AF   676  ^6       JSR WRTVTOC
AD86 4C 7F B3   677           JMP NOERROR
AD89            678  ;
AD89            679  ;
AD89            680  ; FREESECT, DEALLOCATES A SECTOR
AD89            681  ; IN THE TRACK BIT MAP
AD89            682  ;
AD89 38         683  FREESECT SEC 
AD8A 20 DD B2   684           JSR RORBITMP
AD8D A9 00      685           LDA #0
AD8F A2 05      686           LDX #5
AD91 9D F0 B5   687  ^7       STA SCALAREA,X
AD94 CA         688           DEX 
AD95 10 FA      689           BPL <7
AD97 60         690           RTS 
AD98            691  ;
AD98            692  ;
AD98            693  ;
AD98            694  ; CATALOG HANDLER
AD98            695  ;
AD98 20 DC AB   696  CATHNDLR JSR INITFMW
AD9B            697  ;
AD9B            698  ; ALLOW ANY VOLUME OF DISK
AD9B            699  ; ($FF COMPLIMENTED = VOL 0)
AD9B            700  ;
AD9B A9 FF      701           LDA #$FF
AD9D 8D F9 B5   702           STA VOLNUMBR
ADA0            703  ;
ADA0            704  ; READ VTOC TO FIND OUT WHERE
ADA0            705  ; THE CATALOG IS
ADA0            706  ;
ADA0 20 F7 AF   707           JSR RWVTOC
ADA3            708  ;
ADA3            709  ; SET UP COUNTER TO STOP EVERY 22
ADA3            710  ; LINES
ADA3            711  ;
ADA3 A9 16      712           LDA #$16
ADA5 8D 9D B3   713           STA CNTR
ADA8            714  ;
ADA8            715  ;
ADA8            716  ; SKIP TWO LINES AND PRINT
ADA8            717  ; "DISK VOLUME"

LISA 2.5                                                     


ADA8            718  ;
ADA8 20 2F AE   719           JSR SKIPLN
ADAB 20 2F AE   720           JSR SKIPLN
ADAE A2 0B      721           LDX #$B
ADB0 BD AF B3   722  ^8       LDA DISKVOL,X
ADB3 20 ED FD   723           JSR COUT
ADB6 CA         724           DEX 
ADB7 10 F7      725           BPL <8
ADB9            726  ;
ADB9            727  ; PRINT THE VOLUME NUMBER
ADB9            728  ;
ADB9 86 45      729           STX OPRND+1
ADBB AD F6 B7   730           LDA VOLFND
ADBE 85 44      731           STA OPRND
ADC0 20 42 AE   732           JSR PRTDEC
ADC3 20 2F AE   733           JSR SKIPLN
ADC6 20 2F AE   734           JSR SKIPLN
ADC9            735  ;
ADC9            736  ;
ADC9            737  ;  PRINT ALL THE DIRECTORY ENTRIES
ADC9            738  ;
ADC9 18         739           CLC 
ADCA 20 11 B0   740  RDNXTDIR JSR RDDIRSEC
ADCD B0 5D      741           BCS DONEXT2
ADCF A2 00      742           LDX #0
ADD1 8E 9C B3   743  GTRKNUM  STX DIRINDX
ADD4 BD C6 B4   744           LDA TSTRACK,X
ADD7            745  ;
ADD7            746  ; IF TRACK BYTE IS ZERO, END OF
ADD7            747  ; DIRECTORY HAS BEEN REACHED,
ADD7            748  ; IF MINUS, FILE WAS DELETED AND
ADD7            749  ; SHOULD NOT BE LISTED.
ADD7            750  ;
ADD7 F0 53      751           BEQ DONEXT2
ADD9 30 4A      752           BMI DONEXT
ADDB            753  ;
ADDB            754  ; SEE IF THE FILE IS LOCKED
ADDB            755  ;
ADDB A0 A0      756           LDY #" "
ADDD BD C8 B4   757           LDA FILTYP,X
ADE0 10 02      758           BPL >9
ADE2 A0 AA      759           LDY #"*"
ADE4 98         760  ^9       TYA 
ADE5 20 ED FD   761           JSR COUT
ADE8            762  ;
ADE8            763  ;
ADE8            764  ; OUTPUT FILE TYPE
ADE8            765  ;
ADE8 BD C8 B4   766           LDA FILTYP,X
ADEB 29 7F      767           AND #$7F
ADED A0 07      768           LDY #7
ADEF 0A         769           ASL 
ADF0 0A         770  ^0       ASL 
ADF1 B0 03      771           BCS >1
ADF3 88         772           DEY 
ADF4 D0 FA      773           BNE <0
ADF6 B9 A7 B3   774  ^1       LDA FTTBL,Y
ADF9 20 ED FD   775           JSR COUT

LISA 2.5                                                     


ADFC A9 A0      776           LDA #$A0
ADFE 20 ED FD   777           JSR COUT
AE01            778  ;
AE01            779  ; OUTPUT FILE SIZE
AE01            780  ;
AE01 BD E7 B4   781           LDA FILESIZE,X
AE04 85 44      782           STA OPRND
AE06 BD E8 B4   783           LDA FILESIZE+1,X
AE09 85 45      784           STA OPRND+1
AE0B 20 42 AE   785           JSR PRTDEC
AE0E A9 A0      786           LDA #$A0
AE10 20 ED FD   787           JSR COUT
AE13 E8         788           INX 
AE14 E8         789           INX 
AE15 E8         790           INX 
AE16            791  ;
AE16            792  ; OUTPUT FILE NAME
AE16            793  ;
AE16 A0 1D      794           LDY #$1D
AE18 BD C6 B4   795  ^2       LDA TSTRACK,X
AE1B 20 ED FD   796           JSR COUT
AE1E E8         797           INX 
AE1F 88         798           DEY 
AE20 10 F6      799           BPL <2
AE22 20 2F AE   800           JSR SKIPLN
AE25            801  ;
AE25            802  ; GET NEXT DIR ENTRY (READING A
AE25            803  ; DIR SECTOR IF REQ'D)
AE25            804  ;
AE25 20 30 B2   805  DONEXT   JSR NXTDIREN
AE28 90 A7      806           BCC GTRKNUM
AE2A B0 9E      807           BCS RDNXTDIR
AE2C            808  ;
AE2C            809  ; DIR ALL DONE
AE2C            810  ;
AE2C 4C 7F B3   811  DONEXT2  JMP NOERROR
AE2F            812  ;
AE2F            813  ; SKIPLN- PRINTS A <CR> AND
AE2F            814  ; CHECKS TO SEE IF THE CNTR
AE2F            815  ; HAS BECOME ZERO OR NOT
AE2F            816  ;
AE2F A9 8D      817  SKIPLN   LDA #$8D
AE31 20 ED FD   818           JSR COUT
AE34 CE 9D B3   819           DEC CNTR
AE37 D0 08      820           BNE >3
AE39 20 0C FD   821           JSR RDCHAR
AE3C A9 15      822           LDA #$15
AE3E 8D 9D B3   823           STA CNTR
AE41 60         824  ^3       RTS 
AE42            825  ;
AE42            826  ;
AE42            827  ; PRTDEC- PRINTS (OPRAND,OPRAND+1)
AE42            828  ; AS A DECIMAL INTEGER.
AE42            829  ;
AE42 A0 02      830  PRTDEC   LDY #2
AE44 A9 00      831  PRTDEC2  LDA #0
AE46 48         832           PHA 
AE47 A5 44      833  ^4       LDA OPRND

LISA 2.5                                                     


AE49 D9 A4 B3   834           CMP DECTBL,Y
AE4C 90 12      835           BCC >5
AE4E F9 A4 B3   836           SBC DECTBL,Y
AE51 85 44      837           STA OPRND
AE53 A5 45      838           LDA OPRND+1
AE55 E9 00      839           SBC #0
AE57 85 45      840           STA OPRND+1
AE59 68         841           PLA 
AE5A 69 00      842           ADC #0
AE5C 48         843           PHA 
AE5D 4C 47 AE   844           JMP <4
AE60 68         845  ^5       PLA 
AE61 09 B0      846           ORA #$B0
AE63 20 ED FD   847           JSR COUT
AE66 88         848           DEY 
AE67 10 DB      849           BPL PRTDEC2
AE69 60         850           RTS 
AE6A            851  ;
AE6A            852  ;
AE6A            853  ; LOAD FILE MANAGER WORK AREA
AE6A            854  ; FROM THE FILE BUFFER.
AE6A            855  ;
AE6A 20 08 AF   856  LDFMW    JSR SELBUF
AE6D A0 00      857           LDY #0
AE6F 8C C5 B5   858           STY RTNCODE
AE72 B1 42      859  ^6       LDA (BUFADR),Y
AE74 99 D1 B5   860           STA FTSTS,Y
AE77 C8         861           INY 
AE78 C0 2D      862           CPY #$2D
AE7A D0 F6      863           BNE <6
AE7C 18         864           CLC 
AE7D 60         865           RTS 
AE7E            866  ;
AE7E            867  ; SAVE FILE MANAGER WORK AREA INTO
AE7E            868  ; FILE BUFFER
AE7E            869  ;
AE7E 20 08 AF   870  SAVFMW   JSR SELBUF
AE81 A0 00      871           LDY #0
AE83 B9 D1 B5   872  ^9       LDA FTSTS,Y
AE86 91 42      873           STA (BUFADR),Y
AE88 C8         874           INY 
AE89 C0 2D      875           CPY #$2D
AE8B D0 F6      876           BNE <9
AE8D 60         877           RTS 
AE8E            878  ;
AE8E            879  ;
AE8E            880  ; INIT FUNCTION HANDLER.
AE8E            881  ;
AE8E 20 DC AB   882  INITHNDL JSR INITFMW
AE91 A9 04      883           LDA #4
AE93            884  ;
AE93            885  ;
AE93            886  ; INIT VTOC INFO
AE93            887  ;
AE93 20 58 B0   888           JSR SETCMDCD
AE96            889  ;
AE96            890  ; Volume # must be complimented.
AE96            891  ;

LISA 2.5                                                     


AE96 AD F9 B5   892           LDA VOLNUMBR
AE99 49 FF      893           EOR #$FF
AE9B 8D C1 B3   894           STA DSKVOL
AE9E            895  ;
AE9E            896  ; Set up next track to allocate
AE9E            897  ; at track 17.
AE9E            898  ;
AE9E A9 11      899           LDA #$11
AEA0 8D EB B3   900           STA NXTTOALC
AEA3            901  ;
AEA3            902  ; Allocate sectors in positive
AEA3            903  ; direction (from $11 up).
AEA3            904  ;
AEA3 A9 01      905           LDA #$1
AEA5 8D EC B3   906           STA ALLCDIR
AEA8            907  ;
AEA8            908  ; Mark the "possible" 56 tracks
AEA8            909  ; as all being used.
AEA8            910  ;
AEA8 A2 38      911           LDX #$38
AEAA A9 00      912           LDA #0
AEAC 9D BB B3   913  ^0       STA VTOCSB,X
AEAF E8         914           INX 
AEB0 D0 FA      915           BNE <0
AEB2            916  ;
AEB2            917  ; Mark the Apple's 35 tracks as
AEB2            918  ; unused.
AEB2            919  ;
AEB2            920  ; Track 0 is not marked as unused
AEB2            921  ;
AEB2            922  ;
AEB2 A2 0C      923           LDX #$C
AEB4 E0 8C      924  ^1       CPX #$8C
AEB6 F0 14      925           BEQ >3
AEB8 A0 03      926           LDY #3
AEBA B9 A0 B3   927  ^2       LDA FREEMASK,Y
AEBD 9D F3 B3   928           STA BITMAP,X
AEC0 E8         929           INX 
AEC1 88         930           DEY 
AEC2 10 F6      931           BPL <2
AEC4 E0 44      932           CPX #$44
AEC6 D0 EC      933           BNE <1
AEC8 A2 48      934           LDX #$48
AECA D0 E8      935           BNE <1
AECC 20 FB AF   936  ^3       JSR WRTVTOC
AECF            937  ;
AECF            938  ; INIT DIRECTORY INFO
AECF            939  ;
AECF A2 00      940           LDX #0
AED1 8A         941           TXA 
AED2 9D BB B4   942  ^4       STA DIRSECBF,X
AED5 E8         943           INX 
AED6 D0 FA      944           BNE <4
AED8 20 45 B0   945           JSR PRWTSDIR
AEDB            946  ;
AEDB            947  ; Set up for directory track
AEDB            948  ;
AEDB A9 11      949           LDA #$11

LISA 2.5                                                     


AEDD            950  ;
AEDD            951  ; Set up for dir sector.
AEDD            952  ;
AEDD AC F0 B3   953           LDY NUMSCTRS
AEE0 88         954           DEY 
AEE1 88         955           DEY 
AEE2 8D EC B7   956           STA TNUM
AEE5            957  ;
AEE5            958  ; Write directory sectors out to
AEE5            959  ; disk.
AEE5            960  ;
AEE5 8D BC B4   961  ^5       STA TSNXTDIR
AEE8 8C BD B4   962  ^6       STY TSNXTDIR+1
AEEB C8         963           INY 
AEEC 8C ED B7   964           STY SNUM
AEEF A9 02      965           LDA #2
AEF1 20 58 B0   966           JSR SETCMDCD
AEF4 AC BD B4   967           LDY TSNXTDIR+1
AEF7 88         968           DEY 
AEF8 30 05      969           BMI >7
AEFA D0 EC      970           BNE <6
AEFC 98         971           TYA 
AEFD F0 E6      972           BEQ <5
AEFF 20 C2 B7   973  ^7       JSR RWTSPRMS
AF02            974  ;
AF02            975  ; WRITE DOS OUT TO DISK
AF02            976  ;
AF02 20 4A B7   977           JSR PUTDOS
AF05 4C 7F B3   978           JMP NOERROR
AF08            979  ;
AF08            980  ;
AF08            981  ; SELECT A BUFFER,
AF08            982  ;
AF08            983  ; FILE MANAGER WORK BUFFER
AF08            984  ;
AF08 A2 00      985  SELBUF   LDX #0
AF0A F0 06      986           BEQ >8
AF0C            987  ;
AF0C            988  ; SELECT T/S LIST BUFFER
AF0C            989  ;
AF0C A2 02      990  SELTSBUF LDX #2
AF0E D0 02      991           BNE >8
AF10            992  ;
AF10            993  ;
AF10            994  ; SELECT DATA BUFFER
AF10            995  ;
AF10 A2 04      996  SELDABUF LDX #4
AF12 BD C7 B5   997  ^8       LDA WBADR,X
AF15 85 42      998           STA BUFADR
AF17 BD C8 B5   999           LDA WBADR+1,X
AF1A 85 43     1000           STA BUFADR+1
AF1C 60        1001           RTS 
AF1D           1002  ;
AF1D           1003  ;
AF1D           1004  ; CHECK DATA BUFFER TO SEE IF IT
AF1D           1005  ; NEEDS TO BE WRITTEN TO DISK
AF1D           1006  ;
AF1D 2C D5 B5  1007  CHKBUF   BIT FLAGS

LISA 2.5                                                     


AF20 70 01     1008           BVS >9
AF22 60        1009           RTS 
AF23 20 E4 AF  1010  ^9       JSR PREPDATA
AF26 A9 02     1011           LDA #2
AF28 20 52 B0  1012           JSR RWTSDRVR
AF2B A9 BF     1013           LDA #$BF
AF2D 2D D5 B5  1014           AND FLAGS
AF30 8D D5 B5  1015           STA FLAGS
AF33 60        1016           RTS 
AF34           1017  ;
AF34           1018  ;
AF34           1019  ; CHECK T/S LIST BUFFER TO SEE
AF34           1020  ; IF IT MUST BE WRITTEN TO DISK
AF34           1021  ;
AF34 AD D5 B5  1022  CHKTS    LDA FLAGS
AF37 30 01     1023           BMI SETUPRW
AF39 60        1024           RTS 
AF3A 20 4B AF  1025  SETUPRW  JSR PREPRWTS
AF3D A9 02     1026           LDA #2
AF3F 20 52 B0  1027           JSR RWTSDRVR
AF42 A9 7F     1028           LDA #$7F
AF44 2D D5 B5  1029           AND FLAGS
AF47 8D D5 B5  1030           STA FLAGS
AF4A 60        1031           RTS 
AF4B           1032  ;
AF4B           1033  ;
AF4B           1034  ; SET UP IOB FOR RWTS CALL
AF4B           1035  ;
AF4B AD C9 B5  1036  PREPRWTS LDA TSLSTADR
AF4E 8D F0 B7  1037           STA USRBUF
AF51 AD CA B5  1038           LDA TSLSTADR+1
AF54 8D F1 B7  1039           STA USRBUF+1
AF57 AE D3 B5  1040           LDX CURTSTS
AF5A AC D4 B5  1041           LDY CURTSS
AF5D 60        1042           RTS 
AF5E           1043  ;
AF5E           1044  ;
AF5E           1045  ; READ A T/S LIST INTO THE FILE
AF5E           1046  ; BUFFER.
AF5E           1047  ;
AF5E           1048  ; ON ENTRY C=0 IF FIRST T/S SECTOR
AF5E           1049  ; IS DESIRED, C=1 IF THE NEXT
AF5E           1050  ; T/S SECTOR IS DESIRED.
AF5E           1051  ;
AF5E 08        1052  RDTSLIST PHP 
AF5F           1053  ;
AF5F           1054  ; First, check to see if the
AF5F           1055  ; current T/S list must be
AF5F           1056  ; written to disk.
AF5F           1057  ;
AF5F 20 34 AF  1058           JSR CHKTS
AF62 20 4B AF  1059           JSR PREPRWTS
AF65 20 0C AF  1060           JSR SELTSBUF
AF68 28        1061           PLP 
AF69 B0 09     1062           BCS >9
AF6B           1063  ;
AF6B           1064  ; If the carry flag is cleared,
AF6B           1065  ; read the first sector of the

LISA 2.5                                                     


AF6B           1066  ; T/S list.
AF6B           1067  ;
AF6B AE D1 B5  1068           LDX FTSTS
AF6E AC D2 B5  1069           LDY FTSS
AF71 4C B5 AF  1070           JMP OLDRWTS
AF74           1071  ;
AF74           1072  ; If the carry flag was set read
AF74           1073  ; in the next sector of the
AF74           1074  ; T/S list.
AF74           1075  ;
AF74 A0 01     1076  ^9       LDY #$1
AF76           1077  ;
AF76           1078  ; If the track number of the next
AF76           1079  ; sector is zero, there isn't
AF76           1080  ; another T/S sector available.
AF76           1081  ;
AF76 B1 42     1082           LDA (BUFADR),Y
AF78 F0 08     1083           BEQ >0
AF7A           1084  ;
AF7A           1085  ; If there is another T/S list
AF7A           1086  ; available read it in.
AF7A           1087  ;
AF7A AA        1088           TAX 
AF7B C8        1089           INY 
AF7C B1 42     1090           LDA (BUFADR),Y
AF7E A8        1091           TAY 
AF7F 4C B5 AF  1092           JMP OLDRWTS
AF82           1093  ;
AF82           1094  ; If the File Manager Opcode is
AF82           1095  ; isn't write, exit with error
AF82           1096  ; status passed in carry.
AF82           1097  ;
AF82 AD BB B5  1098  ^0       LDA FMOPCOD
AF85 C9 04     1099           CMP #4
AF87 F0 02     1100           BEQ >1
AF89 38        1101           SEC 
AF8A 60        1102           RTS 
AF8B           1103  ;
AF8B           1104  ; If writing to disk, simply
AF8B           1105  ; allocate another sector for
AF8B           1106  ; the T/S list and continue.
AF8B           1107  ;
AF8B 20 44 B2  1108  ^1       JSR ALLOCSEC
AF8E A0 02     1109           LDY #2
AF90 91 42     1110           STA (BUFADR),Y
AF92 48        1111           PHA 
AF93 88        1112           DEY 
AF94 AD F1 B5  1113           LDA SCALAREA+1
AF97 91 42     1114           STA (BUFADR),Y
AF99 48        1115           PHA 
AF9A 20 3A AF  1116           JSR SETUPRW
AF9D 20 D6 B7  1117           JSR ZEROBUFR
AFA0 A0 05     1118           LDY #5
AFA2 AD DE B5  1119           LDA RELSLAST
AFA5 91 42     1120           STA (BUFADR),Y
AFA7 C8        1121           INY 
AFA8 AD DF B5  1122           LDA RELSLAST+1
AFAB 91 42     1123           STA (BUFADR),Y

LISA 2.5                                                     


AFAD 68        1124           PLA 
AFAE AA        1125           TAX 
AFAF 68        1126           PLA 
AFB0 A8        1127           TAY 
AFB1 A9 02     1128           LDA #2
AFB3 D0 02     1129           BNE >0
AFB5           1130  ;
AFB5           1131  ; If Acc=1, read old T/S list.
AFB5           1132  ; If Acc=2, write new sector for
AFB5           1133  ; T/S list.
AFB5           1134  ;
AFB5 A9 01     1135  OLDRWTS  LDA #$1
AFB7 8E D3 B5  1136  ^0       STX CURTSTS
AFBA 8C D4 B5  1137           STY CURTSS
AFBD 20 52 B0  1138           JSR RWTSDRVR
AFC0           1139  ;
AFC0           1140  ; Compute relative sector number
AFC0           1141  ; of the last sector represented
AFC0           1142  ; in this T/S list and store
AFC0           1143  ; in workarea.
AFC0           1144  ;
AFC0 A0 05     1145           LDY #5
AFC2 B1 42     1146           LDA (BUFADR),Y
AFC4 8D DC B5  1147           STA RELSFRST
AFC7 18        1148           CLC 
AFC8 6D DA B5  1149           ADC SECPERTS
AFCB 8D DE B5  1150           STA RELSLAST
AFCE C8        1151           INY 
AFCF B1 42     1152           LDA (BUFADR),Y
AFD1 8D DD B5  1153           STA RELSFRST+1
AFD4 6D DB B5  1154           ADC SECPERTS+1
AFD7 8D DF B5  1155           STA RELSLAST+1
AFDA 18        1156           CLC 
AFDB 60        1157           RTS 
AFDC           1158  ;
AFDC           1159  ;
AFDC           1160  ; READ A DATA SECTOR
AFDC           1161  ;
AFDC 20 E4 AF  1162  RDDASEC  JSR PREPDATA
AFDF A9 01     1163           LDA #$1
AFE1 4C 52 B0  1164           JMP RWTSDRVR
AFE4           1165  ;
AFE4           1166  ; PREP RWTS' IOB FOR READING
AFE4           1167  ; A DATA SECTOR.
AFE4           1168  ;
AFE4 AC CB B5  1169  PREPDATA LDY DATASADR
AFE7 AD CC B5  1170           LDA DATASADR+1
AFEA 8C F0 B7  1171           STY USRBUF
AFED 8D F1 B7  1172           STA USRBUF+1
AFF0 AE D6 B5  1173           LDX CURDATS
AFF3 AC D7 B5  1174           LDY CURDAS
AFF6 60        1175           RTS 
AFF7           1176  ;
AFF7           1177  ;
AFF7           1178  ; READ OR WRITE THE VTOC
AFF7           1179  ;
AFF7 A9 01     1180  RWVTOC   LDA #$1
AFF9 D0 02     1181           BNE >1

LISA 2.5                                                     


AFFB A9 02     1182  WRTVTOC  LDA #2
AFFD AC C3 AA  1183  ^1       LDY VTOCPADR
B000 8C F0 B7  1184           STY USRBUF
B003 AC C4 AA  1185           LDY VTOCPADR+1
B006 8C F1 B7  1186           STY USRBUF+1
B009 AE FA B5  1187           LDX TRKNUMBR
B00C A0 00     1188           LDY #0
B00E 4C 52 B0  1189           JMP RWTSDRVR
B011           1190  ;
B011           1191  ;
B011           1192  ; READ A DIRECTORY SECTOR
B011           1193  ;
B011           1194  ; If C=0 read first dir sector.
B011           1195  ; If C=1 read next dir sector.
B011           1196  ;
B011           1197  ;
B011 08        1198  RDDIRSEC PHP 
B012 20 45 B0  1199           JSR PRWTSDIR
B015 28        1200           PLP 
B016 B0 08     1201           BCS >2
B018           1202  ;
B018           1203  ; Read first directory sector here
B018           1204  ;
B018 AC BD B3  1205           LDY FRSTTS+1
B01B AE BC B3  1206           LDX FRSTTS
B01E D0 0A     1207           BNE >4
B020 AE BC B4  1208  ^2       LDX TSNXTDIR
B023 D0 02     1209           BNE >3
B025           1210  ;
B025           1211  ;
B025           1212  ; If there are no more dir
B025           1213  ; sectors, exit with error flag
B025           1214  ; (carry) set.
B025           1215  ;
B025 38        1216           SEC 
B026 60        1217           RTS 
B027           1218  ;
B027           1219  ; Read next dir sector in chain
B027           1220  ; here.
B027           1221  ;
B027 AC BD B4  1222  ^3       LDY TSNXTDIR+1
B02A 8E 97 B3  1223  ^4       STX DIRTS
B02D 8C 98 B3  1224           STY DIRTS+1
B030 A9 01     1225           LDA #$1
B032 20 52 B0  1226           JSR RWTSDRVR
B035 18        1227           CLC 
B036 60        1228           RTS 
B037           1229  ;
B037           1230  ; WRITE A DIRECTORY SECTOR
B037           1231  ;
B037 20 45 B0  1232  WRTDIRSC JSR PRWTSDIR
B03A AE 97 B3  1233           LDX DIRTS
B03D AC 98 B3  1234           LDY DIRTS+1
B040 A9 02     1235           LDA #2
B042 4C 52 B0  1236           JMP RWTSDRVR
B045           1237  ;
B045           1238  ;
B045           1239  ; PREP RWTS FOR DIRECTORY READ/WRT

LISA 2.5                                                     


B045           1240  ;
B045 AD C5 AA  1241  PRWTSDIR LDA DIRPADR
B048 8D F0 B7  1242           STA USRBUF
B04B AD C6 AA  1243           LDA DIRPADR+1
B04E 8D F1 B7  1244           STA USRBUF+1
B051 60        1245           RTS 
B052           1246  ;
B052           1247  ; RWTS DRIVER, FINISHES UP THE IOB
B052           1248  ; AND CALLS THE RWTS ROUTINE
B052           1249  ;
B052 8E EC B7  1250  RWTSDRVR STX TNUM
B055 8C ED B7  1251           STY SNUM
B058 8D F4 B7  1252  SETCMDCD STA CMDCODE
B05B C9 02     1253           CMP #2
B05D D0 06     1254           BNE >4
B05F           1255  ;
B05F           1256  ; If writing to disk, note this
B05F           1257  ; in "FLAGS".
B05F           1258  ;
B05F 0D D5 B5  1259           ORA FLAGS
B062 8D D5 B5  1260           STA FLAGS
B065           1261  ;
B065           1262  ; Compliment the volume number
B065           1263  ;
B065 AD F9 B5  1264  ^4       LDA VOLNUMBR
B068 49 FF     1265           EOR #$FF
B06A 8D EB B7  1266           STA VOLEXPT
B06D           1267  ;
B06D           1268  ; Init such niceties as slot,
B06D           1269  ; drive, sector, etc.
B06D           1270  ;
B06D AD F7 B5  1271           LDA SLOT16
B070 8D E9 B7  1272           STA SNUM16
B073 AD F8 B5  1273           LDA DRVNUMBR
B076 8D EA B7  1274           STA DNUM
B079 AD E2 B5  1275           LDA SECTLEN
B07C 8D F2 B7  1276           STA BYTCNT
B07F AD E3 B5  1277           LDA SECTLEN+1
B082 8D F3 B7  1278           STA BYTCNT+1
B085 A9 01     1279           LDA #$1
B087 8D E8 B7  1280           STA TBLTYPE
B08A           1281  ;
B08A           1282  ; Call the RWTS subroutine
B08A           1283  ;
B08A AC C1 AA  1284           LDY RWTSPADR
B08D AD C2 AA  1285           LDA RWTSPADR+1
B090 20 B5 B7  1286           JSR CALLRWTS
B093           1287  ;
B093           1288  ; Fiddle with the volume numbers
B093           1289  ; before checking for an error
B093           1290  ;
B093           1291  ;
B093 AD F6 B7  1292           LDA VOLFND
B096 8D BF B5  1293           STA VOLVAL
B099 A9 FF     1294           LDA #$FF
B09B 8D EB B7  1295           STA VOLEXPT
B09E           1296  ;
B09E           1297  ; If no error, quit

LISA 2.5                                                     


B09E           1298  ;
B09E B0 01     1299           BCS >5
B0A0 60        1300           RTS 
B0A1           1301  ;
B0A1           1302  ;
B0A1           1303  ; Convert RWTS error # to an
B0A1           1304  ; error number usable by the
B0A1           1305  ; file manager.
B0A1           1306  ;
B0A1 AD F5 B7  1307  ^5       LDA ERRRCODE
B0A4 A0 07     1308           LDY #7
B0A6 C9 20     1309           CMP #$20
B0A8 F0 08     1310           BEQ >6
B0AA A0 04     1311           LDY #4
B0AC C9 10     1312           CMP #$10
B0AE F0 02     1313           BEQ >6
B0B0 A0 08     1314           LDY #8
B0B2 98        1315  ^6       TYA 
B0B3 4C 85 B3  1316           JMP SETERROR
B0B6           1317  ;
B0B6           1318  ;
B0B6           1319  ; READ NEXT DATA SECTOR IF REQ'D
B0B6           1320  ;
B0B6           1321  ;
B0B6           1322  ; Check to see if the current file
B0B6           1323  ; position is in the current data
B0B6           1324  ; sector buffered up in memory.
B0B6           1325  ;
B0B6 AD E4 B5  1326  RDNXTDA  LDA FILEPOSN
B0B9 CD E0 B5  1327           CMP RELSLRD
B0BC D0 08     1328           BNE >7
B0BE AD E5 B5  1329           LDA FILEPOSN+1
B0C1 CD E1 B5  1330           CMP RELSLRD+1
B0C4 F0 66     1331           BEQ SLDBUF2
B0C6           1332  ;
B0C6           1333  ; If not, see if the current
B0C6           1334  ; sector needs to be written to
B0C6           1335  ; disk.
B0C6           1336  ;
B0C6 20 1D AF  1337  ^7       JSR CHKBUF
B0C9           1338  ;
B0C9           1339  ;
B0C9           1340  ; Is the desired file position
B0C9           1341  ; within the range of sectors
B0C9           1342  ; represented by the T/S list
B0C9           1343  ; currently buffered in memory?
B0C9           1344  ;
B0C9 AD E5 B5  1345  ^8       LDA FILEPOSN+1
B0CC CD DD B5  1346           CMP RELSFRST+1
B0CF 90 1C     1347           BCC >0              ;go if <
B0D1 D0 08     1348           BNE >9              ;go if >
B0D3 AD E4 B5  1349           LDA FILEPOSN
B0D6 CD DC B5  1350           CMP RELSFRST
B0D9 90 12     1351           BCC >0
B0DB           1352  ;
B0DB AD E5 B5  1353  ^9       LDA FILEPOSN+1
B0DE CD DF B5  1354           CMP RELSLAST+1
B0E1 90 10     1355           BCC FNDTS

LISA 2.5                                                     


B0E3 D0 08     1356           BNE >0
B0E5 AD E4 B5  1357           LDA FILEPOSN
B0E8 CD DE B5  1358           CMP RELSLAST
B0EB 90 06     1359           BCC FNDTS
B0ED           1360  ;
B0ED           1361  ; Read in new T/S list, Carry is
B0ED           1362  ; set or cleared from CMP's above.
B0ED           1363  ;
B0ED           1364  ;
B0ED 20 5E AF  1365  ^0       JSR RDTSLIST
B0F0 90 D7     1366           BCC <8
B0F2 60        1367           RTS 
B0F3           1368  ;
B0F3           1369  ; DATA WAS FOUND IN CURRENT T/S
B0F3           1370  ; LIST, GET ENTRY IN THIS T/S LIST
B0F3           1371  ;
B0F3 38        1372  FNDTS    SEC 
B0F4 AD E4 B5  1373           LDA FILEPOSN
B0F7 ED DC B5  1374           SBC RELSFRST
B0FA 0A        1375           ASL 
B0FB 69 0C     1376           ADC #$C
B0FD A8        1377           TAY 
B0FE 20 0C AF  1378           JSR SELTSBUF
B101 B1 42     1379           LDA (BUFADR),Y
B103 D0 0F     1380           BNE READOLD
B105 AD BB B5  1381           LDA FMOPCOD
B108 C9 04     1382           CMP #4
B10A F0 02     1383           BEQ >1
B10C 38        1384           SEC 
B10D 60        1385           RTS 
B10E 20 34 B1  1386  ^1       JSR ADDATA
B111 4C 20 B1  1387           JMP SAVSECNM
B114           1388  ;
B114           1389  ; READ EXISTING DATA USING CURRENT
B114           1390  ; T/S LIST
B114           1391  ;
B114 8D D6 B5  1392  READOLD  STA CURDATS
B117 C8        1393           INY 
B118 B1 42     1394           LDA (BUFADR),Y
B11A 8D D7 B5  1395           STA CURDAS
B11D 20 DC AF  1396           JSR RDDASEC
B120           1397  ;
B120           1398  ; SAVE SECTOR NUMBER OF SECTOR
B120           1399  ; LAST READ IN THE WORKAREA
B120           1400  ;
B120 AD E4 B5  1401  SAVSECNM LDA FILEPOSN
B123 8D E0 B5  1402           STA RELSLRD
B126 AD E5 B5  1403           LDA FILEPOSN+1
B129 8D E1 B5  1404           STA RELSLRD+1
B12C           1405  ;
B12C           1406  ;
B12C           1407  ; SELECT DATA BUFFER
B12C           1408  ;
B12C 20 10 AF  1409  SLDBUF2  JSR SELDABUF
B12F AC E6 B5  1410           LDY FILEPOSN+2
B132 18        1411           CLC 
B133 60        1412           RTS 
B134           1413  ;

LISA 2.5                                                     


B134           1414  ; ADD A NEW DATA SECTOR TO THE
B134           1415  ; FILE
B134           1416  ;
B134 8C 9D B3  1417  ADDATA   STY CNTR
B137           1418  ;
B137           1419  ; Allocate a sector for the data.
B137           1420  ;
B137 20 44 B2  1421           JSR ALLOCSEC
B13A           1422  ;
B13A           1423  ; Put T/S numbers into T/S list.
B13A           1424  ;
B13A AC 9D B3  1425           LDY CNTR
B13D C8        1426           INY 
B13E 91 42     1427           STA (BUFADR),Y
B140 8D D7 B5  1428           STA CURDAS
B143 88        1429           DEY 
B144 AD F1 B5  1430           LDA SCALAREA+1
B147 91 42     1431           STA (BUFADR),Y
B149 8D D6 B5  1432           STA CURDATS
B14C           1433  ;
B14C           1434  ; Select data buffer and zero it
B14C           1435  ; out.
B14C           1436  ;
B14C 20 10 AF  1437           JSR SELDABUF
B14F 20 D6 B7  1438           JSR ZEROBUFR
B152           1439  ;
B152           1440  ; set up flags noting that the
B152           1441  ; current data and T/S sectors
B152           1442  ; must be written to disk.
B152           1443  ;
B152 A9 C0     1444           LDA #$C0
B154 0D D5 B5  1445           ORA FLAGS
B157 8D D5 B5  1446           STA FLAGS
B15A 60        1447           RTS 
B15B           1448  ;
B15B           1449  ;
B15B           1450  ;:
B15B           1451  ;
B15B           1452  ;
B15B           1453  ; VARIOUS UTILITIES USED ALL OVER
B15B           1454  ; THE PLACE
B15B           1455  ;
B15B           1456  ;
B15B           1457  ; INCREMENT RECORD NUMBER AND
B15B           1458  ; BYTE OFFSET INTO THE FILE
B15B           1459  ;
B15B AE EA B5  1460  INCREC   LDX RECNUMBR
B15E 8E BD B5  1461           STX RECNUM
B161 AE EB B5  1462           LDX RECNUMBR+1
B164 8E BE B5  1463           STX RECNUM+1
B167 AE EC B5  1464           LDX BYTEOFFS
B16A AC ED B5  1465           LDY BYTEOFFS+1
B16D 8E BF B5  1466           STX VOLVAL
B170 8C C0 B5  1467           STY DRVVAL
B173 E8        1468           INX 
B174 D0 01     1469           BNE >3
B176 C8        1470           INY 
B177 CC E9 B5  1471  ^3       CPY OPNRCLEN+1

LISA 2.5                                                     


B17A D0 11     1472           BNE >4
B17C EC E8 B5  1473           CPX OPNRCLEN
B17F D0 0C     1474           BNE >4
B181 A2 00     1475           LDX #0
B183 A0 00     1476           LDY #0
B185 EE EA B5  1477           INC RECNUMBR
B188 D0 03     1478           BNE >4
B18A EE EB B5  1479           INC RECNUMBR+1
B18D 8E EC B5  1480  ^4       STX BYTEOFFS
B190 8C ED B5  1481           STY BYTEOFFS+1
B193 60        1482           RTS 
B194           1483  ;
B194           1484  ;
B194           1485  ; INCREMENT FILE POSITION
B194           1486  ; OFFSET
B194           1487  ;
B194 EE E6 B5  1488  INCPOS   INC FILEPOSN+2
B197 D0 08     1489           BNE >5
B199 EE E4 B5  1490           INC FILEPOSN
B19C D0 03     1491           BNE >5
B19E EE E5 B5  1492           INC FILEPOSN+1
B1A1 60        1493  ^5       RTS 
B1A2           1494  ;
B1A2           1495  ;
B1A2           1496  ; COPY AND ADVANCE RANGE ADDRESS
B1A2           1497  ;
B1A2 AC C3 B5  1498  MOVRANG  LDY DATABYTE
B1A5 AE C4 B5  1499           LDX DATABYTE+1
B1A8 84 42     1500           STY BUFADR
B1AA 86 43     1501           STX BUFADR+1
B1AC EE C3 B5  1502           INC DATABYTE
B1AF D0 03     1503           BNE >6
B1B1 EE C4 B5  1504           INC DATABYTE+1
B1B4 60        1505  ^6       RTS 
B1B5           1506  ;
B1B5           1507  ; DECREMENT RANGE ADDRESS
B1B5           1508  ;
B1B5 AC C1 B5  1509  DECRNG   LDY SLOTVAL
B1B8 D0 08     1510           BNE >7
B1BA AE C2 B5  1511           LDX FILETYPE
B1BD F0 07     1512           BEQ >8
B1BF CE C2 B5  1513           DEC FILETYPE
B1C2 CE C1 B5  1514  ^7       DEC SLOTVAL
B1C5 60        1515           RTS 
B1C6 4C 7F B3  1516  ^8       JMP NOERROR
B1C9           1517  ;
B1C9           1518  ;
B1C9           1519  ; LOCATE A DIRECTORY ENTRY.
B1C9           1520  ; LOOKS UP A FILENAME IN THE
B1C9           1521  ; DIRECTORY.
B1C9           1522  ;
B1C9           1523  ;
B1C9           1524  ; Read VTOC to get track and
B1C9           1525  ; sector number of first dir
B1C9           1526  ; sector.
B1C9           1527  ;
B1C9 20 F7 AF  1528  LCDIRENT JSR RWVTOC
B1CC AD C3 B5  1529           LDA FNADR

LISA 2.5                                                     


B1CF 85 42     1530           STA BUFADR
B1D1 AD C4 B5  1531           LDA FNADR+1
B1D4 85 43     1532           STA BUFADR+1
B1D6           1533  ;
B1D6           1534  ; Set up for two passes through
B1D6           1535  ; the directory.
B1D6           1536  ;
B1D6 A9 01     1537           LDA #$1
B1D8 8D 9D B3  1538  INITDIR  STA CNTR
B1DB           1539  ;
B1DB           1540  ; Set up index into VTOC for
B1DB           1541  ; the dir track.
B1DB           1542  ;
B1DB A9 00     1543           LDA #0
B1DD 8D D8 B5  1544           STA DIRSECIX
B1E0 18        1545           CLC 
B1E1           1546  ;
B1E1           1547  ; Read in the current dir sector.
B1E1           1548  ;
B1E1 EE D8 B5  1549  INCSECOF INC DIRSECIX
B1E4 20 11 B0  1550           JSR RDDIRSEC
B1E7 B0 51     1551           BCS PASS2
B1E9           1552  ;
B1E9           1553  ; Check for end of dir (if first
B1E9           1554  ; byte is zero) or a deleted
B1E9           1555  ; file (if minus, really should
B1E9           1556  ; be $FF).
B1E9           1557  ;
B1E9 A2 00     1558           LDX #0
B1EB 8E 9C B3  1559  GETRACK  STX DIRINDX
B1EE BD C6 B4  1560           LDA TSTRACK,X
B1F1 F0 1F     1561           BEQ DOPASS2
B1F3 30 22     1562           BMI CHKPASS
B1F5 A0 00     1563           LDY #0
B1F7 E8        1564           INX 
B1F8 E8        1565           INX 
B1F9           1566  ;
B1F9           1567  ;  Compare the filename against
B1F9           1568  ; the current dir entry.
B1F9           1569  ;
B1F9 E8        1570  ^8       INX 
B1FA B1 42     1571           LDA (BUFADR),Y
B1FC DD C6 B4  1572           CMP TSTRACK,X
B1FF D0 0A     1573           BNE >9
B201 C8        1574           INY 
B202 C0 1E     1575           CPY #$1E
B204 D0 F3     1576           BNE <8
B206           1577  ;
B206           1578  ; If found, return with index
B206           1579  ; into sector in the X register
B206           1580  ; and the carry flag cleared.
B206           1581  ;
B206 AE 9C B3  1582           LDX DIRINDX
B209 18        1583           CLC 
B20A 60        1584           RTS 
B20B           1585  ;
B20B           1586  ;
B20B           1587  ; If filename doesn't match

LISA 2.5                                                     


B20B           1588  ; current entry, on to the next 1.
B20B           1589  ;
B20B 20 30 B2  1590  ^9       JSR NXTDIREN
B20E 90 DB     1591           BCC GETRACK
B210 B0 CF     1592           BCS INCSECOF
B212 AC 9D B3  1593  DOPASS2  LDY CNTR
B215 D0 C1     1594           BNE INITDIR
B217 AC 9D B3  1595  CHKPASS  LDY CNTR
B21A D0 EF     1596           BNE <9
B21C           1597  ;
B21C           1598  ;
B21C           1599  ; COPY FILE NAME TO DIRECTORY
B21C           1600  ; ENTRY.
B21C           1601  ;
B21C A0 00     1602  COPYFNAM LDY #0
B21E E8        1603           INX 
B21F E8        1604           INX 
B220 E8        1605  ^0       INX 
B221 B1 42     1606           LDA (BUFADR),Y
B223 9D C6 B4  1607           STA TSTRACK,X
B226 C8        1608           INY 
B227 C0 1E     1609           CPY #$1E
B229 D0 F5     1610           BNE <0
B22B AE 9C B3  1611           LDX DIRINDX
B22E 38        1612           SEC 
B22F 60        1613           RTS 
B230           1614  ;
B230           1615  ; MOVE ON TO THE NEXT DIRECTORY
B230           1616  ; ENTRY.
B230           1617  ;
B230 18        1618  NXTDIREN CLC 
B231 AD 9C B3  1619           LDA DIRINDX
B234 69 23     1620           ADC #$23
B236 AA        1621           TAX 
B237 E0 F5     1622           CPX #$F5
B239 60        1623           RTS 
B23A A9 00     1624  PASS2    LDA #0
B23C AC 9D B3  1625           LDY CNTR
B23F D0 97     1626           BNE INITDIR
B241 4C 77 B3  1627           JMP DSKFULL
B244           1628  ;
B244           1629  ;
B244           1630  ;
B244           1631  ; ALLOCATE A DISK SECTOR.
B244           1632  ;
B244           1633  ; This routine finds a track in
B244           1634  ; the track bit map stored in
B244           1635  ; memory that has some empty
B244           1636  ; sectors left.
B244           1637  ;  ALLOCSEC then allocates the
B244           1638  ; rest of those sectors and
B244           1639  ; gives them to the requesting
B244           1640  ; file.
B244           1641  ;
B244           1642  ;
B244           1643  ;
B244           1644  ; First, see if there is a
B244           1645  ; track already allocated to this

LISA 2.5                                                     


B244           1646  ; file.
B244           1647  ;
B244 AD F1 B5  1648  ALLOCSEC LDA SCALAREA+1
B247 F0 21     1649           BEQ NOTRKAVL
B249           1650  ;
B249           1651  ; If so, decrement sector count
B249           1652  ; to find the next possible
B249           1653  ; sector #.
B249           1654  ;
B249 CE F0 B5  1655  TSTNXT   DEC SCALAREA
B24C 30 17     1656           BMI NOSECAVL
B24E           1657  ;
B24E           1658  ; If a valid sector, rotate the
B24E           1659  ; bit map to see if it is free.
B24E           1660  ;
B24E 18        1661           CLC 
B24F A2 04     1662           LDX #4
B251 3E F1 B5  1663  ^1       ROL SCALAREA+1,X
B254 CA        1664           DEX 
B255 D0 FA     1665           BNE <1
B257           1666  ;
B257           1667  ; If not free, repeat for next
B257           1668  ; sector.
B257           1669  ;
B257 90 F0     1670           BCC TSTNXT
B259           1671  ;
B259           1672  ; If free, allocate and increment
B259           1673  ; file size by one.
B259           1674  ;
B259 EE EE B5  1675           INC SECCNT
B25C D0 03     1676           BNE >2
B25E EE EF B5  1677           INC SECCNT+1
B261 AD F0 B5  1678  ^2       LDA SCALAREA
B264 60        1679           RTS 
B265           1680  ;
B265           1681  ;
B265           1682  ; Indicate that a track is not
B265           1683  ; currently allocated.
B265           1684  ;
B265 A9 00     1685  NOSECAVL LDA #0
B267 8D F1 B5  1686           STA SCALAREA+1
B26A           1687  ;
B26A           1688  ; Reset allocation flag to
B26A           1689  ; allow a complete scan of the
B26A           1690  ; bit map for available sectors.
B26A           1691  ;
B26A A9 00     1692  NOTRKAVL LDA #0
B26C 8D 9E B3  1693           STA ALLCFLG
B26F 20 F7 AF  1694           JSR RWVTOC
B272           1695  ;
B272           1696  ; Add allocation director to
B272           1697  ; NXTTOALLC and see if we are
B272           1698  ; at track zero, or past
B272           1699  ; track 34.
B272           1700  ;
B272 18        1701  ADDIRCTN CLC 
B273 AD EB B3  1702           LDA NXTTOALC
B276 6D EC B3  1703           ADC ALLCDIR

LISA 2.5                                                     


B279 F0 09     1704           BEQ SCNDTIME
B27B CD EF B3  1705           CMP NUMTRKS
B27E 90 14     1706           BCC >3
B280           1707  ;
B280           1708  ; If past track 34, set allocation
B280           1709  ; direction to -1.
B280           1710  ;
B280 A9 FF     1711           LDA #$FF
B282 D0 0A     1712           BNE ATDIRTRK
B284 AD 9E B3  1713  SCNDTIME LDA ALLCFLG
B287 D0 37     1714           BNE DODSKFUL
B289 A9 01     1715           LDA #$1
B28B 8D 9E B3  1716           STA ALLCFLG
B28E           1717  ;
B28E           1718  ; Start at the dir track and
B28E           1719  ; work backwards.
B28E           1720  ;
B28E 8D EC B3  1721  ATDIRTRK STA ALLCDIR
B291 18        1722           CLC 
B292 69 11     1723           ADC #$11
B294 8D EB B3  1724  ^3       STA NXTTOALC
B297 8D F1 B5  1725           STA SCALAREA+1
B29A A8        1726           TAY 
B29B 0A        1727           ASL 
B29C 0A        1728           ASL 
B29D A8        1729           TAY 
B29E A2 04     1730           LDX #4
B2A0 18        1731           CLC 
B2A1 B9 F6 B3  1732  ^4       LDA BTMPEND,Y
B2A4 9D F1 B5  1733           STA SCALAREA+1,X
B2A7 F0 06     1734           BEQ >5
B2A9 38        1735           SEC 
B2AA A9 00     1736           LDA #0
B2AC 99 F6 B3  1737           STA BTMPEND,Y
B2AF 88        1738  ^5       DEY 
B2B0 CA        1739           DEX 
B2B1 D0 EE     1740           BNE <4
B2B3 90 BD     1741           BCC ADDIRCTN
B2B5           1742  ;
B2B5           1743  ; Allocated an entire track,
B2B5           1744  ; write out the VTOC so other
B2B5           1745  ; files don't use 'em
B2B5           1746  ;
B2B5 20 FB AF  1747           JSR WRTVTOC
B2B8 AD F0 B3  1748           LDA NUMSCTRS
B2BB 8D F0 B5  1749           STA SCALAREA
B2BE D0 89     1750           BNE TSTNXT
B2C0 4C 77 B3  1751  DODSKFUL JMP DSKFULL
B2C3           1752  ;
B2C3           1753  ;
B2C3           1754  ; RELEASE ANY ALLOCATED SECTORS
B2C3           1755  ; THAT WERE NOT USED.
B2C3           1756  ;
B2C3 AD F1 B5  1757  RLSALLC  LDA SCALAREA+1
B2C6 D0 01     1758           BNE >6
B2C8 60        1759           RTS 
B2C9 48        1760  ^6       PHA 
B2CA 20 F7 AF  1761           JSR RWVTOC

LISA 2.5                                                     


B2CD AC F0 B5  1762           LDY SCALAREA
B2D0 68        1763           PLA 
B2D1 18        1764           CLC 
B2D2 20 DD B2  1765           JSR RORBITMP
B2D5 A9 00     1766           LDA #0
B2D7 8D F1 B5  1767           STA SCALAREA+1
B2DA 4C FB AF  1768           JMP WRTVTOC
B2DD           1769  ;
B2DD           1770  ;
B2DD           1771  ; ROTATE THE BIT MAP RIGHT ONE
B2DD           1772  ; BIT.
B2DD           1773  ; THIS CHECKS FOR AVAILABLE SECS
B2DD           1774  ;
B2DD           1775  ;
B2DD A2 FC     1776  RORBITMP LDX #$FC
B2DF 7E F6 B4  1777  ^7       ROR TMPBITMP,X
B2E2 E8        1778           INX 
B2E3 D0 FA     1779           BNE <7
B2E5 C8        1780           INY 
B2E6 CC F0 B3  1781           CPY NUMSCTRS
B2E9 D0 F2     1782           BNE RORBITMP
B2EB 0A        1783           ASL 
B2EC 0A        1784           ASL 
B2ED A8        1785           TAY 
B2EE F0 0F     1786           BEQ >9
B2F0 A2 04     1787           LDX #4
B2F2 BD F1 B5  1788  ^8       LDA SCALAREA+1,X
B2F5 19 F6 B3  1789           ORA BTMPEND,Y
B2F8 99 F6 B3  1790           STA BTMPEND,Y
B2FB 88        1791           DEY 
B2FC CA        1792           DEX 
B2FD D0 F3     1793           BNE <8
B2FF 60        1794  ^9       RTS 
B300           1795  ;
B300           1796  ;
B300           1797  ; CALCULATE FILE POSITION.
B300           1798  ;
B300           1799  ; GIVEN A RECORD NUMBER, A FILE
B300           1800  ; LENGTH, AND A BYTE OFFSET THIS
B300           1801  ; ROUTINE CALCULATES THE OFFSET
B300           1802  ; INTO THE FILE TO FIND THE
B300           1803  ; DESIRED RECORD.
B300           1804  ;
B300 AD BD B5  1805  CALPOSN  LDA RECNUM
B303 8D E6 B5  1806           STA FILEPOSN+2
B306 8D EA B5  1807           STA RECNUMBR
B309 AD BE B5  1808           LDA RECNUM+1
B30C 8D E4 B5  1809           STA FILEPOSN
B30F 8D EB B5  1810           STA RECNUMBR+1
B312 A9 00     1811           LDA #0
B314 8D E5 B5  1812           STA FILEPOSN+1
B317 A0 10     1813           LDY #$10
B319 AA        1814  ^0       TAX 
B31A AD E6 B5  1815           LDA FILEPOSN+2
B31D 4A        1816           LSR 
B31E B0 03     1817           BCS >1
B320 8A        1818           TXA 
B321 90 0E     1819           BCC >2

LISA 2.5                                                     


B323 18        1820  ^1       CLC 
B324 AD E5 B5  1821           LDA FILEPOSN+1
B327 6D E8 B5  1822           ADC OPNRCLEN
B32A 8D E5 B5  1823           STA FILEPOSN+1
B32D 8A        1824           TXA 
B32E 6D E9 B5  1825           ADC OPNRCLEN+1
B331 6A        1826  ^2       ROR 
B332 6E E5 B5  1827           ROR FILEPOSN+1
B335 6E E4 B5  1828           ROR FILEPOSN
B338 6E E6 B5  1829           ROR FILEPOSN+2
B33B 88        1830           DEY 
B33C D0 DB     1831           BNE <0
B33E AD BF B5  1832           LDA VOLVAL
B341 8D EC B5  1833           STA BYTEOFFS
B344 6D E6 B5  1834           ADC FILEPOSN+2
B347 8D E6 B5  1835           STA FILEPOSN+2
B34A AD C0 B5  1836           LDA DRVVAL
B34D 8D ED B5  1837           STA BYTEOFFS+1
B350 6D E4 B5  1838           ADC FILEPOSN
B353 8D E4 B5  1839           STA FILEPOSN
B356 A9 00     1840           LDA #0
B358 6D E5 B5  1841           ADC FILEPOSN+1
B35B 8D E5 B5  1842           STA FILEPOSN+1
B35E 60        1843           RTS 
B35F           1844  ;
B35F           1845  ;
B35F           1846  ; MULTIPLY CALLED ERROR MESSAGES
B35F           1847  ;
B35F A9 01     1848  LNOTAVL  LDA #$1
B361 D0 22     1849           BNE SETERROR
B363 A9 02     1850  RANGERR  LDA #2
B365 D0 1E     1851           BNE SETERROR
B367 A9 03     1852  RANGERR2 LDA #3
B369 D0 1A     1853           BNE SETERROR
B36B A9 04     1854           LDA #4
B36D D0 16     1855           BNE SETERROR
B36F A9 05     1856  ENDATA   LDA #5
B371 D0 12     1857           BNE SETERROR
B373 A9 06     1858  FNOTFND  LDA #6
B375 D0 0E     1859           BNE SETERROR
B377 4C ED BF  1860  DSKFULL  JMP DISKFULL
B37A EA        1861           NOP 
B37B A9 0A     1862  FILELOCK LDA #$A
B37D D0 06     1863           BNE SETERROR
B37F AD C5 B5  1864  NOERROR  LDA RTNCODE
B382 18        1865           CLC 
B383 90 01     1866           BCC >3
B385           1867  ;
B385           1868  ; STANDARD ERROR ENTRY POINT
B385           1869  ;
B385 38        1870  SETERROR SEC 
B386 08        1871  ^3       PHP 
B387 8D C5 B5  1872           STA RTNCODE
B38A A9 00     1873           LDA #0
B38C 85 48     1874           STA IOBADR
B38E 20 7E AE  1875           JSR SAVFMW
B391 28        1876           PLP 
B392 AE 9B B3  1877           LDX STKSAVE

LISA 2.5                                                     


B395 9A        1878           TXS 
B396 60        1879           RTS 
B397           1880  ;
B397           1881  ;
B397           1882  ; VARIABLES ETC.
B397           1883  ;
B397           1884  DIRTS    DFS 2
B399           1885  LB399    DFS 2
B39B           1886  STKSAVE  DFS 1
B39C           1887  DIRINDX  DFS 1
B39D           1888  CNTR     DFS 1
B39E           1889  ALLCFLG  DFS 2
B3A0           1890  FREEMASK DFS 4
B3A4 01 0A 64  1891  DECTBL   HEX 010A64
B3A7 D4 C9 C1  1892  FTTBL    ASC "TIABSRAB"
B3AA C2 D3 D2 
B3AD C1 C2 
B3AF A0 C5 CD  1893  DISKVOL  ASC " EMULOV KSID"
B3B2 D5 CC CF 
B3B5 D6 A0 CB 
B3B8 D3 C9 C4 
B3BB           1894  VTOCSB   DFS 1
B3BC           1895  FRSTTS   DFS 2
B3BE 03        1896  DOSRLS   HEX 03
B3BF           1897           DFS 2
B3C1           1898  DSKVOL   DFS $21
B3E2           1899  NUMTSENT DFS 9
B3EB           1900  NXTTOALC DFS 1
B3EC           1901  ALLCDIR  DFS 3
B3EF           1902  NUMTRKS  DFS 1
B3F0           1903  NUMSCTRS DFS 3
B3F3           1904  BITMAP   DFS 3
B3F6           1905  BTMPEND  DFS $C5
B4BB           1906  DIRSECBF DFS 1
B4BC           1907  TSNXTDIR DFS 10
B4C6           1908  TSTRACK  DFS 1
B4C7           1909  TSSECTOR DFS 1
B4C8           1910  FILTYP   DFS $1F
B4E7           1911  FILESIZE DFS $F
B4F6           1912  TMPBITMP DFS $AE
B5A4           1913  LB5A4    DFS $17
B5BB           1914  ;
B5BB           1915  ;
B5BB           1916  ;
B5BB           1917  FMOPCOD  DFS 1
B5BC           1918  SUBCODE  DFS 1
B5BD           1919  RECNUM   DFS 2
B5BF           1920  VOLVAL   DFS 1
B5C0           1921  DRVVAL   DFS 1
B5C1           1922  SLOTVAL  DFS 1
B5C2           1923  FILETYPE DFS 1
B5C3           1924  DATABYTE:
B5C3           1925  FNADR    DFS 2
B5C5           1926  RTNCODE  DFS 2
B5C7           1927  WBADR    DFS 2
B5C9           1928  TSLSTADR DFS 2
B5CB           1929  DATASADR DFS 2
B5CD           1930           DFS 4

LISA 2.5                                                     


B5D1           1931  FTSTS    DFS 1
B5D2           1932  FTSS     DFS 1
B5D3           1933  CURTSTS  DFS 1
B5D4           1934  CURTSS   DFS 1
B5D5           1935  FLAGS    DFS 1
B5D6           1936  CURDATS  DFS 1
B5D7           1937  CURDAS   DFS 1
B5D8           1938  DIRSECIX DFS 2
B5DA           1939  SECPERTS DFS 2
B5DC           1940  RELSFRST DFS 2
B5DE           1941  RELSLAST DFS 2
B5E0           1942  RELSLRD  DFS 2
B5E2           1943  SECTLEN  DFS 2
B5E4           1944  FILEPOSN DFS 3
B5E7           1945           DFS 1
B5E8           1946  OPNRCLEN DFS 2
B5EA           1947  RECNUMBR DFS 2
B5EC           1948  BYTEOFFS DFS 2
B5EE           1949  SECCNT   DFS 2
B5F0           1950  SCALAREA DFS 1
B5F1           1951           DFS 5
B5F6           1952  FTYPE    DFS 1
B5F7           1953  SLOT16   DFS 1
B5F8           1954  DRVNUMBR DFS 1
B5F9           1955  VOLNUMBR DFS 1
B5FA           1956  TRKNUMBR DFS 6
B600           1957  ;
B600           1958  ;
B600           1959  ;
B600           1960  ; START OF 2ND STAGE BOOTSTRAP
B600           1961  ;
B600 01        1962  BOOT     HEX 01
B601 A5 27     1963           LDA SCRATCH
B603 C9 09     1964           CMP #9
B605 D0 18     1965           BNE >0
B607 A5 2B     1966           LDA BOOTSLOT
B609 4A        1967           LSR 
B60A 4A        1968           LSR 
B60B 4A        1969           LSR 
B60C 4A        1970           LSR 
B60D 09 C0     1971           ORA #$C0
B60F 85 3F     1972           STA ROMRWTS+1
B611 A9 5C     1973           LDA #$5C
B613 85 3E     1974           STA ROMRWTS
B615 18        1975           CLC 
B616 AD FE 08  1976           LDA L08FE
B619 6D FF 08  1977           ADC L08FF
B61C 8D FE 08  1978           STA L08FE
B61F AE FF 08  1979  ^0       LDX L08FF
B622 30 15     1980           BMI >1
B624 BD 4D 08  1981           LDA L084D,X
B627 85 3D     1982           STA SECNUM
B629 CE FF 08  1983           DEC L08FF
B62C AD FE 08  1984           LDA L08FE
B62F 85 27     1985           STA SCRATCH
B631 CE FE 08  1986           DEC L08FE
B634 A6 2B     1987           LDX BOOTSLOT
B636 6C 3E 00  1988           JMP (ROMRWTS)

LISA 2.5                                                     


B639 EE FE 08  1989  ^1       INC L08FE
B63C EE FE 08  1990           INC L08FE
B63F 20 89 FE  1991           JSR SETKBD
B642 20 93 FE  1992           JSR SETVID
B645 20 2F FB  1993           JSR MONINIT
B648 A6 2B     1994           LDX BOOTSLOT
B64A 6C FD 08  1995           JMP (L08FD)
B64D           1996  ;
B64D           1997  ;
B64D 00 0D 0B  1998           HEX 000D0B0907
B650 09 07 
B652 0D 03 01  1999           HEX 0D03010E
B655 0E 
B656 0C        2000           HEX 0C
B657 0A 08 06  2001           HEX 0A080604
B65A 04 
B65B 02        2002           HEX 02
B65C 0F        2003           HEX 0F
B65D           2004  ;
B65D           2005  ;
B65D           2006  ; THE FOLLOWING ARE ALL PATCHES
B65D           2007  ; FOR APPEND AND VERIFY
B65D           2008  ;
B65D           2009  ;
B65D 00        2010  APPFLG   BYT 0
B65E 20 64 A7  2011  APNDPTCH JSR LOCBUF
B661 B0 08     2012           BCS >0
B663 A9 00     2013           LDA #0
B665 A8        2014           TAY 
B666 8D 5D B6  2015           STA APPFLG
B669 91 40     2016           STA (DOSIMG),Y
B66B AD C5 B5  2017  ^0       LDA RTNCODE
B66E 4C D2 A6  2018           JMP DOERROR
B671 AD 5D B6  2019           LDA APPFLG
B674 F0 08     2020           BEQ >3
B676 EE BD B5  2021           INC RECNUM
B679 D0 03     2022           BNE >3
B67B EE BE B5  2023           INC RECNUM+1
B67E A9 00     2024  ^3       LDA #0
B680 8D 5D B6  2025           STA APPFLG
B683 4C 46 A5  2026           JMP RWC2
B686 8D BC B5  2027           STA SUBCODE
B689 20 A8 A6  2028           JSR FMDRVR
B68C 20 EA A2  2029           JSR DOCLOSE
B68F 4C 7D A2  2030           JMP DOVERIFY
B692 A0 13     2031           LDY #$13
B694 B1 42     2032  ^4       LDA (BUFADR),Y
B696 D0 14     2033           BNE >7
B698 C8        2034           INY 
B699 C0 17     2035           CPY #$17
B69B D0 F7     2036           BNE <4
B69D A0 19     2037           LDY #$19
B69F B1 42     2038  ^5       LDA (BUFADR),Y
B6A1 99 A4 B5  2039           STA LB5A4,Y
B6A4 C8        2040           INY 
B6A5 C0 1D     2041           CPY #$1D
B6A7 D0 F6     2042           BNE <5
B6A9 4C BC A6  2043  ^6       JMP FMDRVR0

LISA 2.5                                                     


B6AC A2 FF     2044  ^7       LDX #$FF
B6AE 8E 5D B6  2045           STX APPFLG
B6B1 D0 F6     2046           BNE <6
B6B3           2047  ;
B6B3           2048  ;
B6B3           2049           DFS 19,0
B6C6           2050           DFS 24,0
B6DE           2051           DFS 32,0
B6FE           2052  ;
B6FE B6        2053  FRSTPAG  HEX B6
B6FF           2054  ;
B6FF           2055  ;
B6FF           2056  ;
B6FF           2057  ;
B6FF           2058  ; DOS SECOND STAGE BOOT PGM
B6FF           2059  ;
B6FF 09        2060  NUMSECS  HEX 09
B700 8E E9 B7  2061           STX SNUM16
B703 8E F7 B7  2062           STX SLOTFND
B706 A9 01     2063           LDA #$1
B708 8D F8 B7  2064           STA DRVFND
B70B 8D EA B7  2065           STA DNUM
B70E AD E0 B7  2066           LDA NUMPGS
B711 8D E1 B7  2067           STA NSECSRW
B714 A9 02     2068           LDA #2
B716 8D EC B7  2069           STA TNUM
B719 A9 04     2070           LDA #4
B71B 8D ED B7  2071           STA SNUM
B71E AC E7 B7  2072           LDY FRSTBOOT+1
B721 88        2073           DEY 
B722 8C F1 B7  2074           STY USRBUF+1
B725 A9 01     2075           LDA #$1
B727 8D F4 B7  2076           STA CMDCODE
B72A 8A        2077           TXA 
B72B 4A        2078           LSR 
B72C 4A        2079           LSR 
B72D 4A        2080           LSR 
B72E 4A        2081           LSR 
B72F AA        2082           TAX 
B730 A9 00     2083           LDA #0
B732 9D F8 04  2084           STA L04F8,X
B735 9D 78 04  2085           STA L0478,X
B738 20 93 B7  2086           JSR RWPAGES
B73B A2 FF     2087           LDX #$FF
B73D 9A        2088           TXS 
B73E 8E EB B7  2089           STX VOLEXPT
B741 4C C8 BF  2090           JMP REBOOT
B744 20 89 FE  2091           JSR SETKBD
B747 4C 84 9D  2092           JMP DOSSTRT
B74A           2093  ;
B74A           2094  ;
B74A           2095  ; PUTDOS- WRITES DOS ON FIRST
B74A           2096  ; TWO TRACKS OF DISK
B74A           2097  ;
B74A AD E7 B7  2098  PUTDOS   LDA FRSTBOOT+1
B74D 38        2099           SEC 
B74E ED F1 B7  2100           SBC USRBUF+1
B751 8D E1 B7  2101           STA NSECSRW

LISA 2.5                                                     


B754 AD E7 B7  2102           LDA FRSTBOOT+1
B757 8D F1 B7  2103           STA USRBUF+1
B75A CE F1 B7  2104           DEC USRBUF+1
B75D A9 02     2105           LDA #2
B75F 8D EC B7  2106           STA TNUM
B762 A9 04     2107           LDA #4
B764 8D ED B7  2108           STA SNUM
B767 A9 02     2109           LDA #2
B769 8D F4 B7  2110           STA CMDCODE
B76C 20 93 B7  2111           JSR RWPAGES
B76F AD E7 B7  2112           LDA FRSTBOOT+1
B772 8D FE B6  2113           STA FRSTPAG
B775 18        2114           CLC 
B776 69 09     2115           ADC #9
B778 8D F1 B7  2116           STA USRBUF+1
B77B A9 0A     2117           LDA #$A
B77D 8D E1 B7  2118           STA NSECSRW
B780 38        2119           SEC 
B781 E9 01     2120           SBC #$1
B783 8D FF B6  2121           STA NUMSECS
B786 8D ED B7  2122           STA SNUM
B789 20 93 B7  2123           JSR RWPAGES
B78C 60        2124           RTS 
B78D           2125           DFS 6
B793 AD E5 B7  2126  RWPAGES  LDA RWTSPPTR+1
B796 AC E4 B7  2127           LDY RWTSPPTR
B799 20 B5 B7  2128           JSR CALLRWTS
B79C AC ED B7  2129           LDY SNUM
B79F 88        2130           DEY 
B7A0 10 07     2131           BPL >8
B7A2 A0 0F     2132           LDY #$F
B7A4 EA        2133           NOP 
B7A5 EA        2134           NOP 
B7A6 CE EC B7  2135           DEC TNUM
B7A9 8C ED B7  2136  ^8       STY SNUM
B7AC CE F1 B7  2137           DEC USRBUF+1
B7AF CE E1 B7  2138           DEC NSECSRW
B7B2 D0 DF     2139           BNE RWPAGES
B7B4 60        2140           RTS 
B7B5 08        2141  CALLRWTS PHP 
B7B6 78        2142           SEI 
B7B7 20 00 BD  2143           JSR RWTSENT
B7BA B0 03     2144           BCS >9
B7BC 28        2145           PLP 
B7BD 18        2146           CLC 
B7BE 60        2147           RTS 
B7BF 28        2148  ^9       PLP 
B7C0 38        2149           SEC 
B7C1 60        2150           RTS 
B7C2 AD BC B5  2151  RWTSPRMS LDA SUBCODE
B7C5 8D F1 B7  2152           STA USRBUF+1
B7C8 A9 00     2153           LDA #0
B7CA 8D F0 B7  2154           STA USRBUF
B7CD AD F9 B5  2155           LDA VOLNUMBR
B7D0 49 FF     2156           EOR #$FF
B7D2 8D EB B7  2157           STA VOLEXPT
B7D5 60        2158           RTS 
B7D6 A9 00     2159  ZEROBUFR LDA #0

LISA 2.5                                                     


B7D8 A8        2160           TAY 
B7D9 91 42     2161  ^0       STA (BUFADR),Y
B7DB C8        2162           INY 
B7DC D0 FB     2163           BNE <0
B7DE 60        2164           RTS 
B7DF 00        2165           HEX 00
B7E0 1B        2166  NUMPGS   HEX 1B
B7E1 00 0A 1B  2167  NSECSRW  HEX 000A1B
B7E4 E8 B7     2168  RWTSPPTR ADR $B7E8
B7E6 00 B6     2169  FRSTBOOT ADR $B600
B7E8 01        2170  TBLTYPE  HEX 01
B7E9 60        2171  SNUM16   HEX 60
B7EA 01        2172  DNUM     HEX 01
B7EB FF        2173  VOLEXPT  HEX FF
B7EC 0C        2174  TNUM     HEX 0C
B7ED 08 FB B7  2175  SNUM     HEX 08FBB7
B7F0 00 96     2176  USRBUF   ADR $9600
B7F2 00 01     2177  BYTCNT   ADR $100
B7F4 02        2178  CMDCODE  HEX 02
B7F5 07        2179  ERRRCODE HEX 07
B7F6 FE        2180  VOLFND   HEX FE
B7F7 60        2181  SLOTFND  HEX 60
B7F8 01        2182  DRVFND   HEX 01
B7F9 00 00 00  2183  UNUSED   HEX 00000001EFD800
B7FC 01 EF D8 
B7FF 00 
B800           2184           END 


***** END OF ASSEMBLY 

!